
#import "skyCell.h"

//123
@implementation skyCell
@synthesize dataArray1;
@synthesize lblHead;
- (void)dealloc
{
    [dataArray1 release];
    [lblHead release];
    [super dealloc];
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        
        UIImageView *image=[[[UIImageView alloc]initWithFrame:CGRectMake(0,0,320,30)]autorelease];
        image.backgroundColor=[UIColor clearColor];
        image.image=[UIImage imageNamed:@"123@2x.png"];
        
        lbl=[[[UILabel alloc]initWithFrame:CGRectMake(10,5,200,20)]autorelease];
        lbl.backgroundColor=[UIColor clearColor];
        [image addSubview:lbl];
        
        table = [[UITableView alloc]initWithFrame:CGRectMake(110,-75,110,320) style:UITableViewStylePlain];
        table.delegate = self;
        table.dataSource = self;
        table.showsHorizontalScrollIndicator=NO;
        table.showsVerticalScrollIndicator=NO;
        table.transform = CGAffineTransformMakeRotation(M_PI / 2 *3);
        
        [self addSubview:image];
		[self addSubview:table];
    }
    return self;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return  [dataArray1 count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *CellIdentifier = [NSString stringWithFormat:@"cell%d",indexPath.row];
	UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
	if (cell == nil)
    {
        cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];
        cell.transform = CGAffineTransformMakeRotation(M_PI/2);
        lbl.text=lblHead;
        //这里面也可以加一个VIEW，然后放一个UIIMAGEVIEW跟一个lbl类似于腾讯视频的首页的样子
	}
    [[cell textLabel] setText:[dataArray1 objectAtIndex:indexPath.row]];
    cell.textLabel.numberOfLines = 0;
    cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
	return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 200;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"点击%d",[indexPath row]);
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}
@end
